<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        div {
            width: 520px;
            height: 280px;

        }
        </style>
    <script>
        var c=5;
      function lunbo() {
       var d= document.getElementById("im");
       d.src=c+".jpg";
       c--;
       if(c==0){
           c=5;
       }
      setTimeout("lunbo()",1500);
      }


    </script>

</head>
<body onload="lunbo()">
<div id="head">
    <img src="1.jpg" id="im"/>
</div>
</body>
</html>